// Header File
// Created 11/19/2007; 6:40:40 PM

#ifndef __BUILDING_H__
#define __BUILDING_H__

#include "Globals.h"
#include "Constants.h"

// Defines the number of types of buildings
#define BUILDING_NUMBER 67

//Building Structure
typedef struct
{
	char name[25];
	int cost;
	char upkeep;
	char preq;
	char prev;
	bool isWonder;
	char endWonder;
	char isConstructed;
	bool isMilitaristic;
} Building;

Building buildings[BUILDING_NUMBER];
char	buildngsDesc[BUILDING_NUMBER][4][12];

#ifdef INSTALL
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CreateBuildingDescriptions /////////////////////////////////////////////////////////////////////////////////////
// Creates all the buildings' descriptions ////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CBD(int i, char *l1, char *l2, char *l3, char *l4)
{
	strcpy(buildngsDesc[i][0], l1);
	strcpy(buildngsDesc[i][1], l2);
	strcpy(buildngsDesc[i][2], l3);
	strcpy(buildngsDesc[i][3], l4);
}

void CreateBuildingDescriptions()
{
//       "01234567890", "01234567890", "01234567890", "01234567890");
	CBD(0, "Eliminates" , "corruption" , "in the city", ""           );
	CBD(1, "Produce"    , "veteran grd", "units, and" , "heal fast." ); //
	CBD(2, "Keep half"  , "of food"    , "storage on" , "growth."    ); //
	CBD(3, "Up to two"  , "discontnted", "citizens"   , "are content"); //
	CBD(4, "Increases"  , "tax and"    , "luxury by"  , "50%."       ); //
	CBD(5, "Increases"  , "science"    , "output by"  , "50%."       ); //
	CBD(6, "Decreases"  , "corruption" , "by 50%."    , ""           );
	CBD(7, "Triples"    , "def against", "ground"     , "units."     );
	CBD(8, "Allows"     , "city to"    , "go beyond"  , "size 8."    ); //
	CBD(9, "Increases"  , "tax and"    , "luxury by"  , "50% more."  ); //
	CBD(10,"Makes four" , "unhappy"    , "citizens"   , "content."   ); //
	CBD(11,"Increases"  , "science"    , "output by"  , "50% more."  ); //
	CBD(12,"Eliminates" , "pollution"  , "caused by"  , "population.");
	CBD(13,"Makes three", "unhappy"    , "citizens"   , "content."   ); //
	CBD(14,"Increases"  , "resource"   , "output by"  , "50%."       ); //
	CBD(15,"Increases"  , "resource"   , "output by"  , "50% more."  ); //
	CBD(16,"Protects"   , "from a"     , "nuclear"    , "attack."    );
	CBD(17,"Decreases"  , "pollution"  , "caused by"  , "factories." );
	CBD(18,"Increases"  , "factory"    , "output by"  , "50%."       ); //
	CBD(19,"Cleaner %50", "more power" , "than power" , "plant."     ); //
	CBD(20,"Same as"    , "hydro, but" , "risk of"    , "meltdown."  ); //
	CBD(21,"Increases"  , "tax and"    , "luxury by"  , "50% more."  ); //
	CBD(22,"Allows"     , "city to"    , "go beyond"  , "size 12."   ); //
	CBD(23,"Irrigation" , "produces"   , "%50 more"   , "food."      ); //
	CBD(24,"Railroads"  , "produce"    , "%50 more"   , "trade."     ); //
	CBD(25,"Increases"  , "science"    , "output by"  , "50% more."  ); //
	CBD(26,"Doubles"    , "defense"    , "against"    , "air units." );
	CBD(27,"Doubles"    , "defense"    , "against"    , "sea units." );
	CBD(28,"Cleanest"   , "%50 more"   , "power."     , ""           ); //
	CBD(29,"Sea squares", "produce one", "extra food.", ""           ); //
	CBD(30,"Sea squares", "produce one", "extra"      , "shield."    ); //
	CBD(31,"Produce"    , "veteran air", "units, and" , "heal fast." ); //
	CBD(32,"Decreases"  , "troop"      , "unhappiness", "by 1."      );
	CBD(33,"Produce"    , "veteran sea", "units, and" , "heal fast." ); //
	CBD(34,"Part of"    , "the space"  , "ship."      , ""           );
	CBD(35,"Part of"    , "the space"  , "ship."      , ""           );
	CBD(36,"Part of"    , "the space"  , "ship."      , ""           );
	
	CBD(37,"Convert"    , "production" , "into"       , "science."   ); //
	CBD(38,"Convert"    , "production" , "into"       , "trade."     ); //
	
	CBD(39,"Counts as a", "granary in" , "all cities.", ""           ); //
	CBD(40,"One extra"  , "happy"      , "citizen in" , "every city."); //
	CBD(41,"Produce an" , "extra trade", "in other"   , "trade sqrs."); //
	CBD(42,"Sea units"  , "move 1 sqr" , "faster."    , ""           );
	CBD(43,"Recieve"    , "tech known" , "by two"     , "other civs.");
	CBD(44,"Doubles the", "effect of"  , "all temples", ""           ); //
	CBD(45,"Force peace", "in talks"   , "with AI."   , ""           );
	CBD(46,"All ground" , "units"      , "become"     , "veterans."  ); //
	CBD(47,"Every sqr"  , "produces an", "extra"      , "shield."    ); //
	CBD(48,"Free"       , "embassy"    , "with every" , "other civ." ); //
	CBD(49,"Counts as a", "cathedral"  , "in all"     , "cities."    ); //
	CBD(50,"Increases"  , "science"    , "output by"  , "50%."       ); //
	CBD(51,"Increases"  , "sea units"  , "movement by", "two."       );
	CBD(52,"All unhappy", "citizens in", "city are"   , "content."   ); //
	CBD(53,"Automatic"  , "upgrade of" , "all units"  , "obsolete."  );
	CBD(54,"Decreases"  , "unhappy"    , "citizens in", "cities by 2"); //
	CBD(55,"Doubles"    , "science"    , "output of"  , "city."      ); //
	CBD(56,"Pays"       , "maintenance", "for improvs", "that cost 1"); //
	CBD(57,"Two free"   , "technology" , "advances."  , ""           ); //
	CBD(58,"Allows for" , "easy gov\'t", "switching." , ""           );
	CBD(59,"AI attitude", "towards you", "shift in"   , "your favor.");
	CBD(60,"Counts as a", "police stn" , "in all"     , "cities."    );
	CBD(61,"Hydro power", "to every"   , "city."      , ""           ); //
	CBD(62,"Allows"     , "nulcear"    , "weapons for", "all civs."  );
	CBD(63,"Free"       , "embassy"    , "with every" , "other civ." ); //
	CBD(64,"Allows"     , "constrction", "of a"       , "spaceship." );
	CBD(65,"Counts as a", "research"   , "lab in all" , "cities."    ); //
	CBD(66,"One extra"  , "happy"      , "citizen in" , "each city." ); //
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CreateBuilding /////////////////////////////////////////////////////////////////////////////////////////////////
// Creates one building ///////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CreateBuilding(char i, char *name, int cost, char upkeep, char preq, bool isWonder, char prev, char endWonder, bool isMilitaristic)
{
	strcpy(buildings[i].name, name);
	buildings[i].cost = cost * COST_CONST;
	buildings[i].upkeep = upkeep;
	buildings[i].preq = preq;
	buildings[i].isWonder = isWonder;
	buildings[i].prev = prev;
	buildings[i].endWonder = endWonder;
	buildings[i].isConstructed = -1;
	buildings[i].isMilitaristic = isMilitaristic;
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// CreateBuildings ////////////////////////////////////////////////////////////////////////////////////////////////
// Creates all the buildings //////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CreateBuildings()
{
	//             i   name                         C   U     P   W   P   E  Milit
	CreateBuilding(0,  "Palace",                    10, 0,    -1, 0, -1, -1, 0);
	CreateBuilding(1,  "Barracks",                  4,  1,    -1, 0, -1, -1, 1);
	CreateBuilding(2,  "Granary",                   6,  1,    65, 0, -1, -1, 0);
	CreateBuilding(3,  "Temple",                    4,  1,    9,  0, -1, -1, 0);
	CreateBuilding(4,  "MarketPlace",               8,  1,    20, 0, -1, -1, 0);
	CreateBuilding(5,  "Library",                   8,  1,    88, 0, -1, -1, 0);
	CreateBuilding(6,  "Courthouse",                8,  1,    12, 0, -1, -1, 0);
	CreateBuilding(7,  "City Walls",                8,  0,    47, 0, -1, -1, 1);
	CreateBuilding(8,  "Aqueduct",                  8,  2,    18, 0, -1, -1, 1);
	CreateBuilding(9,  "Bank",                      12, 3,    6,  0,  4, -1, 0);
	CreateBuilding(10, "Cathedral",                 12, 3,    55, 0,  3, -1, 0);
	CreateBuilding(11, "University",                16, 3,    85, 0,  5, -1, 0);
	CreateBuilding(12, "Mass Transit",              16, 4,    48, 0, -1, -1, 0);
	CreateBuilding(13, "Colosseum",                 10, 4,    18, 0, -1, -1, 0);
	CreateBuilding(14, "Factory",                   20, 4,    37, 0, -1, -1, 0);
	CreateBuilding(15, "Manufacturing Plant",       32, 6,    72, 0, 14, -1, 0);
	CreateBuilding(16, "SDI Defense",               20, 4,    41, 0, -1, -1, 1);
	CreateBuilding(17, "Recycling Center",          20, 2,    68, 0, -1, -1, 0);
	CreateBuilding(18, "Power Plant",               16, 4,    69, 0, 14, -1, 0);
	CreateBuilding(19, "Hydro Plant",               24, 4,    24, 0, 14, -1, 0);
	CreateBuilding(20, "Nuclear Plant",             16, 2,    59, 0, 14, -1, 0);
	CreateBuilding(21, "Stock Exchange",            16, 4,    22, 0,  9, -1, 0);
	CreateBuilding(22, "Sewer System",              12, 2,    74, 0,  8, -1, 1);
	CreateBuilding(23, "Supermarket",               8,  3,    70, 0, -1, -1, 0);
	CreateBuilding(24, "Superhighways",             20, 5,    5,  0, -1, -1, 0);
	CreateBuilding(25, "Research Lab",              16, 3,    16, 0, 11, -1, 0);
	CreateBuilding(26, "SAM Missile Battery",       10, 2,    73, 0, -1, -1, 1);
	CreateBuilding(27, "Coastal Fortress",          8,  1,    51, 0, -1, -1, 1);
	CreateBuilding(28, "Solar Plant",               32, 4,    26, 0, 14, -1, 0);
	CreateBuilding(29, "Harbor",                    6,  1,    75, 0, -1, -1, 0);
	CreateBuilding(30, "Offshore Platform",         16, 3,    52, 0, -1, -1, 0);
	CreateBuilding(31, "Airport",                   16, 3,    66, 0, -1, -1, 1);
	CreateBuilding(32, "Police Station",            6,  2,    15, 0, -1, -1, 1);
	CreateBuilding(33, "Port Facility",             8,  3,    2,  0, -1, -1, 1);
	CreateBuilding(34, "SS Structural",             8,  0,    76, 0, -1, -1, 0);
	CreateBuilding(35, "SS Component",              16, 0,    62, 0, -1, -1, 0);
	CreateBuilding(36, "SS Module",                 32, 0,    80, 0, -1, -1, 0);
	
	CreateBuilding(37, "(Science)",                 99,  0,    -1, 0, -1, -1, 0);
	CreateBuilding(38, "(Trade)",                   99,  0,    -1, 0, -1, -1, 0);
	
	CreateBuilding(39, "Pyramids",                  20, 0,    47, 1, -1, -1, 0);
	CreateBuilding(40, "Hanging Gardens",           20, 0,    65, 1, -1, 67, 0);
	CreateBuilding(41, "Colossus",                  20, 0,    8,  1, -1, 30, 0);
	CreateBuilding(42, "Lighthouse",                20, 0,    46, 1, -1, 45, 1);
	CreateBuilding(43, "Great Library",             30, 0,    43, 1, -1, 23, 0);
	CreateBuilding(44, "Oracle",                    30, 0,    56, 1, -1, 82, 0);
	CreateBuilding(45, "Great Wall",                30, 0,    47, 1, -1, 51, 1);
	CreateBuilding(46, "Sun Tzu\'s War Academy",    30, 0,    29, 1, -1, 53, 1);
	CreateBuilding(47, "King Richard\'s Crusade",   30, 0,    25, 1, -1, 37, 0);
	CreateBuilding(48, "Marco Polo\'s Embassy",     20, 0,    84, 1, -1, 15, 1);
	CreateBuilding(49, "Michelangelo\'s Chapel",    40, 0,    55, 1, -1, -1, 0);
	CreateBuilding(50, "Copernicus\' Observatory",  30, 0,    3,  1, -1, -1, 0);
	CreateBuilding(51, "Magellan\'s Expedition",    40, 0,    57, 1, -1, -1, 1);
	CreateBuilding(52, "Shakespeare\'s Theatre",    30, 0,    50, 1, -1, -1, 0);
	CreateBuilding(53, "Leonardo\'s Workshop",      40, 0,    38, 1, -1,  5, 1);
	CreateBuilding(54, "J. S. Bach\'s Cathedral",   40, 0,    82, 1, -1, -1, 0);
	CreateBuilding(55, "Isaac Newton\'s College",   40, 0,    83, 1, -1, -1, 0);
	CreateBuilding(56, "Adam Smith\'s Trading Co.", 40, 0,    22, 1, -1, -1, 0);
	CreateBuilding(57, "Darwin\'s Voyage",          40, 0,    67, 1, -1, -1, 0);
	CreateBuilding(58, "Statue of Liberty",         40, 0,    21, 1, -1, -1, 0);
	CreateBuilding(59, "Eiffel Tower",              30, 0,    78, 1, -1, -1, 0);
	CreateBuilding(60, "Women\'s Suffrage",         60, 0,    37, 1, -1, -1, 0);
	CreateBuilding(61, "Hoover Dam",                60, 0,    24, 1, -1, -1, 0);
	CreateBuilding(62, "Manhattan Project",         60, 0,    58, 1, -1, -1, 1);
	CreateBuilding(63, "United Nations",            60, 0,    15, 1, -1, -1, 1);
	CreateBuilding(64, "Apollo Program",            60, 0,    76, 1, -1, -1, 0);
	CreateBuilding(65, "SETI Program",              60, 0,    16, 1, -1, -1, 1);
	CreateBuilding(66, "Cure for Cancer",           60, 0,    33, 1, -1, -1, 0);
	
	CreateBuildingDescriptions();
}
#endif // INSTALL

#endif
